<template>
   <div @click.stop="clickTap(item,$event)" class="tree" v-for="item in data">
    <input v-model="item.checked" type="checkbox"> <span>{{item.name}}</span>
    <Inzv v-if="item?.children?.length"  :data="item?.children" ></Inzv>
   </div>
</template>

<script setup lang='ts'>
import {ref ,reactive} from 'vue'

interface Tree{
  name:string,
  checked:boolean,
  children?:Tree[]
}
//自定义组件名称
defineProps<{
    data?: Tree[]
}>()
defineOptions({
    name: 'Inzv',
});
const clickTap = (item:Tree, e)=>{
console.log(item,e.target);

}
</script>


<style scoped>
.tree{
    margin-left: 10px;
}
</style>